VR10AscToSBy

V = Variables

R = Reading functions

ASCII —→ SIGNED BYTE

The VR10AscToSBy function converts an Ascii variable type in an Signed Byte type (byte with sign).

IMPLEMENTATION

VR10AscToSBy (array, index, return, errcode)

Parameters:

IN/OUTVARIABLE TYPEEXAMPLE NAMEDIM
IN ARRGBL array B Array containing the data to be converted (must be declared with at least “index + 1” items)
IN GLOBAL index L Index of the array element at the beginning of the data
OUT GLOBAL return B Data value converted
OUT GLOBAL errcode F Variable that indicates a possible error on function

Errcode

Una volta richiamata la funzione, 'errcode' può assumere determinati valori, il significato di tali valori è riassunto di seguito:
0: Nessun errore
1: Errore: valore ASCII non compreso tra 48÷57 o 65÷70

Esempio

Trasforma il valore -5 (ASCII) in un valore signed byte

index = 1
array[1] = 49
array[2] = 52
 
VR10AscToSBy (array, index, return, errcode)
 
;Sul dato return  si troverà :
; return = 20    (14H)

Note